Skip to main content

Flow Calling Node

The Flow Calling node lets you invoke another chatflow (sub-flow) from within your current conversation. This enables you to break complex conversations into reusable modules or delegate specific tasks to specialized flows.


πŸ” Overview​

  • Purpose: Chain multiple chatflows together, passing control (and optionally context) from one to another.
  • Use cases:
    • Delegate a payment flow from a main support flow.
    • Reuse an onboarding flow across different entry points.
    • Organize large flows into smaller, maintainable components.

βš™οΈ Configuration Options​

1. Model & Instruction​

  • Model (required): Choose which LLM (e.g., gpt-4 or gpt-3.5-turbo) will be used when invoking the subflow.
  • Instruction (optional): A system prompt that modifies how the LLM interprets the transition into the subflow. This can help maintain tone, style, or context for the subflow's execution.

2. Select Chat Flow​

  • Field: Select Chat Flow (required)
  • Type: Dropdown
  • Content: Lists all published chatflows in the current project (e.g., Chatflow for Recruiting, DataAgent).
  • Purpose: Select the target flow you want to invoke next.

πŸ”„ How It Works​

  1. Trigger: When execution reaches the Flow Calling node, the current flow pauses.
  2. Invoke: The selected subflow is launched in a fresh context but inherits any variables passed via the Instruction or shared context.
  3. Return: After the subflow completes or reaches its own end, control returns to the parent flow at the next node.
  4. Continue: Variables set or modified within the subflow can be referenced by the parent flow to guide further logic.

Example:

Main Flow:
… β†’ Flow Calling [ Select β€œDataAgent” ] β†’ [ resumes here after DataAgent completes ] β†’ …

πŸš€ Best Practices​

  • Name flows descriptively: Use clear and meaningful names like OnboardingFlow or PaymentFlow to clarify intent.
  • Limit deep nesting: Avoid chaining flows that themselves call multiple other flows to reduce complexity and debugging difficulty.
  • Pass context sparingly: Share only the necessary variables with the subflow; keep unrelated state isolated to avoid unexpected behavior.
  • Version carefully: When updating a subflow, ensure all parent flows invoking it continue to work as expected.
  • Use Instructions: Use system prompt instructions to control the tone, style, or behavior within the subflow during transitions.

Tip: You can chain multiple Flow Calling nodes consecutively to build complex multi-module conversations, but always thoroughly test the full end-to-end user experience!